import {
	get,
	post
} from '@/utils/network.js'

export const applyShop = params => {
	return post('Increased.shop/ApplyShop', params)
}

/**
 * 店铺列表
 */
export const shopList = params => {
	return post('Increased.shop/getShopList', params)
}

/**
 * 获取推荐标签
 */
export const shopLabel = params => {
	return post('Increased.shop/GetShopLabel', params)
}
/**
 * 获取店铺分类
 */
export const shopCate = params => {
	return post('Increased.shop/GetShopCate', params)
}

/**
 * 商品分类
 */
export const getGoodsCategory = params => {
	return post('shop.shop/GetGoodsCategory', params)
}
// =======================================================
/**
 * 获取店铺内部分类
 */
export const getShopGoodsCategory = params => {
	return post('shop.shop/GetShopGoodsCategory', params)
}

/**
 * 添加店铺内分类
 * @param name 分类名称
 * @param image 分类图片
 * @param pid 上级ID
 */
export const addShopCategory = params => {
	return post('shop.shop/AddShopCategory', params)
}

/**
 * 修改店铺内分类
 * @param ids 分类ID
 * @param name 分类名称
 * @param image 分类图片
 */
export const editShopCategory = params => {
	return post('shop.shop/EditShopCategory', params)
}

/**
 * 删除店铺内分类
 */
export const delShopCategory = params => {
	return post('shop.shop/DelShopCategory', params)
}

// =====================================================

/**
 * 获取店铺品牌
 */
export const getBrandList = params => {
	return post('shop.shop/GetBrandList', params)
}

/**
 * 添加品牌
 */
export const addBrand = params => {
	return post('shop.shop/AddBrand', params)
}

/**
 * 修改品牌
 * @param ids 品牌ID
 * @param name 品牌名称
 * @param image 品牌图片
 */
export const editBrand = params => {
	return post('shop.shop/EditBrand', params)
}

/**
 * 删除品牌
 * @param ids 品牌ID
 */
export const delBrand = params => {
	return post('shop.shop/DelBrand', params)
}

/**
 * 添加商品
 *	@param title 标题
 *	@param category_id 商城分类
 *	@param shop_category_id 店铺内分类
 *	@param freight_id 运费模版
 *	@param image 商品图
 *	@param images 商品轮播图
 *	@param spu 
 *	@param sku 
 */
export const addGoods = params => {
	return post('shop.shop/AddGoods', params)
}

/**
 * 获取商品详情
 * @param id
 */
export const getGoodsDetailis = params => {
	return post('shop.shop/GetGoodsDetailis', params)
}

/**
 * 修改商品
 *  @param id id
 *	@param title 标题
 *	@param category_id 商城分类
 *	@param shop_category_id 店铺内分类
 *	@param freight_id 运费模版
 *	@param image 商品图
 *	@param images 商品轮播图
 *	@param spu 
 *	@param sku 
 */
export const editGoods = params => {
	return post('shop.shop/EditGoods', params)
}

/**
 * 群聊列表
 */
export const getGroupList = params => {
	return post('Increased.shop/GetGroupList')
}

// export const 

/**
 * 运费
 * =============================================
 */

/**
 * 获取模版列表
 */
export const getLogisticsList = params => {
	return post('shop.shop/GetLogisticsList', params)
}

/**
 * 获取所有模版列表（没有分页）
 */
export const getGoodsLogistics = () => {
	return post('shop.shop/GetGoodsLogistics')
}

/**
 * @param {string} name 运费模版名称
 * @param {string} isdelivery 是否包邮:0=自定义运费,1=卖家包邮
 * @param {string} valuation 计价方式:0=按件数,1=按重量,2=按体积
 * @param {string} delivery 发货时间:0=4小时内,1=8小时内,2=12小时内,3=16小时内,4=20小时内,5=1天内,6=2天内,7=3天内,8=4天内,9=5天内,10=7天内,11=8天内,12=10天内,13=12天内,14=15天内,15=17天内,16=20天内,17=25天内,18=30天内
 * @param {
	 [‘province’:’1,2,3,4,5,6’,
	 ’citys’:”1,2,3,3,4,4’,
	 ’first’:’100,
	 ’first_fee’:1,
	 additional:1,
	 additional_fee:1]
	 } quList 所选区域
 * @param {int} logistics_id 修改时传递 id
 * 
 * 添加/修改运费模版
 */
export const addLogistics = params => {
	return post('shop.shop/add_logistics', params)
}

/**
 * 获取运费模版详情
 */
export const getLogisticsDetails = params => {
	return post('shop.shop/GetLogisticsDetails', params)
}

/**
 * 删除运费模版
 * @param {int} logistics_id 运费模版
 */
export const delLogistics = params => {
	return post('shop.shop/DelLogistics', params)
}